A JavaScript Seashore (explanation) |
|
| Description |
This example demonstrates how one can generate music on the fly, simply using JavaScript and the Beatnik Player's LiveConnect methods. There are no RMF or MIDI files being played here - just some intelligent JavaScript. The result is a seashore soundtrack that is never repetitive, can go on for hours, and that doesn't require loading a large music file since the player is instantiated on the page using a stub file.
There are 5 MIDI channels being used, each one playing the General MIDI wave sound (program 122), panned from left to right across the stereo field. At timed intervals, new random numbers are generated to update these waves. The pitch of the waves does not jump all over the place but follows a randomized rising and falling pattern. JavaScript is also used to slowly flip through the images, resulting in a "slideshow" style experience. |
| Methods Used | noteOn, setController, setMonophonic, stubEmbed |
| Skill Level | Advanced |
| Start... | |